This page has been superceded by a wiki version of this example: NestedCommentsExample
This program doesn't do anything, but it's well-documented.
/*
nested_comments.html
Author: J C Calvarese
License: public domain
This program demonstrates using comments in D.
(Such as the multi-line comment this sentence resides in.)
*/
/+
This is one of D's nested comments.
/+ What would an example of a nested comment be without
a nested (and /+ another nest +/ )comment? +/
/* Naturally, you can also put something like this in a nested multiline comments... */
// as well as text like like this ...
/* since the compiler is only concerned about being in a nested comment block,
you don't actually need a matching * and / to satisfy the compiler.
+/
void main()
{ // This is a single line comment. It automatically ends at the end of the line.
}
There are three different kinds of comments in D: